<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>注册</title>
<style>
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #f0f2f5;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  margin: 0;
}
.container {
  background-color: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  width: 350px;
}
h2 {
  margin-top: 0;
  text-align: center;
  color: #333;
}
form {
  display: flex;
  flex-direction: column;
}
input[type="text"],
input[type="password"] {
  padding: 12px 15px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}
button {
  padding: 12px;
  margin-top: 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}
button:hover {
  background-color: #0069d9;
}
.message {
  margin-top: 10px;
  font-size: 14px;
  color: #d9534f;
}
</style>
</head>
<body>
<div class="container">
<h2>注册</h2>
{{if .error}}
<div class="message">{{.error}}</div>
{{end}}
{{if .message}}
<div class="success">{{.message}}</div>
{{end}}
<form method="post" action="/register">
<label for="username">用户名</label>
<input type="text" id="username" name="username" required />
<label for="password">密码</label>
<input type="password" id="password" name="password" required />
<button type="submit">注册</button>
</form>
<p style="text-align:center; margin-top:10px;">
已有账号？<a href="/login">登录</a>
</p>
</div>
</body>
</html>
